const Koa = require('koa')
const fs = require('fs').promises
const app = new Koa()

const main = async(ctx) => { // 异步中间件函数
    ctx.response.type = 'html'
    ctx.response.body = await fs.readFile('./template.html','utf-8')
    console.log(123);
}

app.use(main)
app.listen(3000,() => {
    console.log('项目已启动');
})